<?php

namespace Biz\model\activity;

class SNJActivityRecord extends \Doraemon\pockets\datebase\BaseDbModel
{
    const _CONFIG_FILE_ = 'db_store';

    const _CONFIG_SELECT_ = 'db_brand_activity';

    const _DATABASE_ = 'brand_activity';

    const _TABLE_NAME = 'snj_activity_record';

    const NORMAL_TYPE = 1 ;//普通用户

    const DESIGN_TYPE = 2 ;//设计师用户


    const WALL_PRODUCTS_TYPES = [
         1 => '纯色系列',
         2 => '木纹系列',
         3 => '造物系列',
         4 => '织物系列',
         5 => '主题系列'
    ];

    const GROUND_PRODUCT_TYPES = [
         1 => '简约花色',
         2 => '个性花色'
    ];

    public static function inserRecord($data)
    {
        $data['addtime'] = date("Y-m-d H:i:s");
        if (self::insert($data)->rowcount()) {
            return self::id();
        } else {
            return false;
        }
    }

    public static function updateRecord($data)
    {
        $data['edittime'] = date("Y-m-d H:i:s");
        return self::update($data,['id' => $data['id']]);
    }

    public static function getRecordByCondition($condition)
    {
        return self::get("*" , $condition);
    }


    public static function getRecordListByCondition($condition)
    {
        return self::select("*" , $condition);
    }






}